package com.wejoy.video.middle.station.data.enums.dict;

/**
 * @Author miracle_j
 * Create by 2024/12/11 12:07
 */
public enum EnumVideoCameraMiniType {
    // 普通监控、云台监控、激光云台、移动布控球
    NORMAL(20,"普通监控"),
    PTZ(21,"云台监控"),
    LASER_PTZ(22,"激光云台"),
    MOBILE_CONTROL(23,"移动布控球")
            ;

    private Integer code;
    private String text;

    EnumVideoCameraMiniType(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    /**
     * 通过code获得该枚举类型
     * @param code
     * @return
     */
    public static EnumVideoCameraMiniType getByCode(Integer code) {
        EnumVideoCameraMiniType[] values = EnumVideoCameraMiniType.values();
        for(EnumVideoCameraMiniType type : values) {
            if(type.code == code) {
                return type;
            }
        }
        return null;
    }

    /**
     * 通过code获得该枚举类型
     * @param text
     * @return
     */
    public static EnumVideoCameraMiniType getByTxt(String text) {
        EnumVideoCameraMiniType[] values = EnumVideoCameraMiniType.values();
        for(EnumVideoCameraMiniType type : values) {
            if(type.text.equals(text)) {
                return type;
            }
        }
        return null;
    }
}
